#pragma once
#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include "headers.h"

namespace Ui {
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private:
    Ui::MainWindow *ui;

    QString defaultGrammarFile;
    QLineEdit* firstSymbolTXT;
    QListWidget* nonterminalsList;
    QListWidget* terminalsList;
    QListWidget* rulesList;
    QTableWidget* actionTableWidget;
    QTableWidget* gotoTableWidget;
    QListWidget* errorsList;
    QLabel* statusText;
    Grammar grammar;
    ParserGenerator* gen;
    void PrintGrammar();

private slots:
    void loadDefaultGrammar();
    bool loadGrammarFromFile();
    void generateParser();
    void saveControlTables();
};

#endif // MAINWINDOW_H
